package com.joezj.util;
import cn.hutool.core.io.resource.ClassPathResource;
import com.aspose.words.Document;
import com.aspose.words.License;
import com.aspose.words.SaveFormat;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBUtil {
    static String driverClass="oracle.jdbc.driver.OracleDriver"; //oracle的驱动
    static String url="jdbc:oracle:thin:@localhost:1521:helowin";// port sid
    static String user="hnkzx_qry";   //user是数据库的用户名
    static String password="hnkzx_qry";  //用户登录密码

    public static Connection getconn() {
        Connection conn=null;
        try {
            //首先建立驱动
            Class.forName("oracle.jdbc.driver.OracleDriver");//反射
            //驱动成功后进行连接
            conn=DriverManager.getConnection(url, user, password);

            System.out.println("连接成功");
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return conn; //返回一个连接
    }


}
